<%@ page language="java" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.lang.*,java.util.Vector,java.util.StringTokenizer" %>
<%String userid="";%>
<HTML>
    <HEAD>

    <script LANGUAGE="Javascript" SRC="Images/validate.js"></script>

    <LINK href="styles.css" type="text/css" rel="stylesheet">
    <script LANGUAGE="Javascript" SRC="Images/calender.js"></script>
<script LANGUAGE="Javascript">
		function ChkMandatoryField(F,T){
			var val= F.value;
			if(val==""){alert(T+" is mandatory");return false;}
		}
		function ChkNumField(F,T){
			var val = F.value;
			if(isNaN(val)==true||val==""){alert("Please enter numbers for "+T);return false;}
		}
		function ChkAlphaNumericField(F,T){
			var val = F.value;
			var pattern = /^([a-zA-Z0-9]{1,250})$/;
			if(!(pattern.test(val)==true)){alert("Please enter alphabets or numbers for "+T);return false;}
		}
		function ChkAlphaField(F,T){
			var val = F.value;
			var pattern = /^([a-zA-Z ]{1,250})$/;
			if(!(pattern.test(val)==true)){alert("Please enter text for "+T);return false;}
		}
		function ChkEmailField(F,T){
			var val = F.value;
			var pattern = /^[a-zA-Z0-9\_\.]+\@[a-zA-Z\.]+\.([a-z]{2,4})$/;
			if(!(pattern.test(val)==true)){alert("Please enter valid email for "+T);return false;}
		}
		function ChkDateField(F,T)
		{
			var val = F.value;
		    var pattern = /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;
		    if(!(pattern.test(val)==true)){alert("Please enter valid date format (yyyy-mm-dd) for "+T);return false;}
		}
		function DoPassWordValidation()
			{
			  var frm = document.forms(0);
			  if(frm.password.value != frm.retypepassword.value)
			  {
				alert('The Password and verified password does not match');
				return false;
			  }
			  else
			  {
				return true;
			  }
			}
	
		function validate()
		{	
			
			var frm = document.forms(0);
			if(ChkMandatoryField(frm.userid,'User Name')==false) return false;
			if(ChkMandatoryField(frm.password,'Password')==false) return false;
			if(ChkMandatoryField(frm.retypepassword,'retypepassword')==false) return false;
			if(DoPassWordValidation()==false) return false;
			if(ChkMandatoryField(frm.EmployeeName,'Employee Name')==false) return false;
			if(ChkAlphaField(frm.EmployeeName,'Employee Name')==false) return false;
			if(ChkMandatoryField(frm.EmpNo,'Employ Number')==false) return false;
			if(ChkMandatoryField(frm.CompanyName,'Company Name')==false) return false;
			if(ChkMandatoryField(frm.ContactNo,'Contact Number')==false) return false;
			if(ChkMandatoryField(frm.EmailID,'Email ID')==false) return false;
			if(ChkEmailField(frm.EmailID,'Email ID')==false) return false;
			if(ChkMandatoryField(frm.DateOfRegistration,'DateOfRegistration')==false) return false;
			if(ChkDateField(frm.DateOfRegistration,'DateOfRegistration')==false) return false;
			if(ChkMandatoryField(frm.Cost,'Cost')==false) return false;
			if(ChkNumField(frm.Cost,'Cost')==false) return false;
		}
	function fnCheckDetails(U)
		{
			var frm = document.forms(0);
			var userid = frm.userid.value;
			if (userid=='')
			{
				alert("Please Enter userid to Proceed");
			}else
			{
				var URL = U+"?userid="+userid;
				fnEmpPopUp(URL,200,400);
			}
		}
	</script>
	</HEAD>
	<Body class=Grad>
	<P align=right><a href="Register0.jsp" target="ResultFrame">
<img border="0" name="UserReg" src="Images/JobseekerRegistration1.jpg" width="144" height="29" onmouseover="document['UserReg'].src='Images/JobseekerRegistration0.jpg'" onmouseout="document['UserReg'].src='Images/JobseekerRegistration1.jpg'" ></a></P>

	<H3 align=center>Employ Registration </H2>
<FORM NAME="RegEmp" ACTION="EmployRegistration1.jsp" OnSubmit="return validate()">
 <TABLE BORDER="0" CELLSPACING="2"  CELLPADDING="2" ><center>
<TR class="row_title">
	<Td align=center> Employ Details<BR></Td>
</TR>
</TR>
		<TR class=row_odd><TH align="left">Choose User Name
		<FONT COLOR="red">*</TH>
		<TD class=row_even>&nbsp;&nbsp;<Input type=text name='userid' value=''><A onclick="fnCheckDetails('CheckAvailbility.jsp')"><img border="0"  name="Check" src="Images/Check01.jpg" width="122" height="24" onmouseover="document['Check'].src='Images/Check1.jpg'" onmouseout="document['Check'].src='Images/Check01.jpg'" ></a></P></a>
		</TR>		
		<TR class=row_odd><TH align="left">Password
		<FONT COLOR="red">*</TH>
		<TD class=row_even>&nbsp;&nbsp;<Input type=password name='password' value=''>
		</TR>

		<TR class=row_odd><TH align="left">Re Type Password
		<FONT COLOR="red">*</TH>
		<TD class=row_even>&nbsp;&nbsp;<Input type=password name='retypepassword' value=''>

		</TR>
		<TR class=row_odd>
				<TH align="left">Employee Name<FONT COLOR="red">*</FONT></TH>
				<TD class=row_even>&nbsp;&nbsp;<Input type=text name='EmployeeName' value=''></TD>
		</TR>
		<TR class=row_odd>
				<TH align="left">Employee No<FONT COLOR="red">*</FONT></TH>
				<TD class=row_even>&nbsp;&nbsp;<Input type=text name='EmpNo' value=''></TD>
		</TR>
		<TR class=row_odd>
				<TH align="left">Company Name<FONT COLOR="red">*</FONT></TH>
				<TD class=row_even>&nbsp;&nbsp;<Input type=text name='CompanyName' value=''></TD>
		</TR>
		<TR class=row_odd>
				<TH align="left">Contact Number<FONT COLOR="red">*</FONT></TH>
				<TD class=row_even>&nbsp;&nbsp;<Input type=text name='ContactNo' value=''></TD>
		</TR>
		<TR class=row_odd>
				<TH align="left">Email ID<FONT COLOR="red">*</FONT></TH>
				<TD class=row_even>&nbsp;&nbsp;<Input type=text name='EmailID' value=''></TD>
		</TR>
		<TR class=row_odd>
				<TH align="left">Date Of Registration<FONT COLOR="red">*</FONT></TH>
				<TD class=row_even>&nbsp;&nbsp;<Input type=text name='DateOfRegistration' value=''><img onkeypress="fnCalendar(this)" id="imgDate" style="CURSOR: hand" onClick="fnCalendar(this)" height="16" src="Images/CalDis.gif" width="16" border="0" name="imgDate" onMouseOver="fnEnableCalLookup(this)" onMouseOut="fnDisableCalLookup(this)" ></TD>
		</TR>
		<TR class=row_odd>
				<TH align="left">Cost<FONT COLOR="red">*</FONT></TH>
				<TD class=row_even>&nbsp;&nbsp;<Input type=text name='Cost' value=''></TD>
		</TR>
		<TR><TH><INPUT TYPE="submit" value='Register' class=Button></TH>
		<TH><INPUT TYPE="reset" value='Clear' class=Button></TH></TR>
	</TABLE>
	<H6 align=center>Fields with <FONT SIZE="" COLOR="red">*</FONT> are mandatory </H6>
	</FORM>
</BODY>
</HEAD>
</HTML>
